import axios from 'axios';
import showMessage from '../utils/showMessage.js';

const ins = axios.create();//创建一个axios实例
ins.interceptors.response.use(function (resp) {
    // console.log('拦截器')
    if (resp.data.code !== 0) {
        showMessage({ content: resp.data.msg, type: 'error' })
        return null;


    }
    return resp.data.data;
})

export default ins;